package com.example.idachuappone.index.welcomentity;

import java.io.Serializable;

import org.json.JSONObject;

public class Events implements Serializable {
	private String description;
	private String ext_url;
	private String head;
	private int is_multi_media;
	private String title;
	private String url;

	public Events parseJson(JSONObject json) {
		if (json == null) {
			return null;
		}
		if (json.has("title")) {
			this.title = json.optString("title");
		}
		if (json.has("url")) {
			this.url = json.optString("url");
		}
		if (json.has("ext_url")) {
			this.ext_url = json.optString("ext_url");
		}
		if (json.has("description")) {
			this.description = json.optString("description").replace("n", "\n");
		}
		if (json.has("head")) {
			this.head = json.optString("head");
		}
		if (!json.has("is_multi_media")) {
			return this;
		}
		this.is_multi_media = json.optInt("is_multi_media");
		return this;
	}

	public Events(String title, String url, String ext_url, String description, int is_multi_media, String head) {
		this.title = title;
		this.url = url;
		this.ext_url = ext_url;
		this.description = description;
		this.is_multi_media = is_multi_media;
		this.head = head;
	}

	/**
	 * 
	 */
	public Events() {
		// TODO Auto-generated constructor stub
	}

	public String getTitle() {
		return this.title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getUrl() {
		return this.url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public String getDescription() {
		return this.description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getHead() {
		return this.head;
	}

	public void setHead(String head) {
		this.head = head;
	}

	public int getIs_multi_media() {
		return this.is_multi_media;
	}

	public void setIs_multi_media(int is_multi_media) {
		this.is_multi_media = is_multi_media;
	}

	public String getExt_url() {
		return this.ext_url;
	}

	public void setExt_url(String ext_url) {
		this.ext_url = ext_url;
	}
}
